<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>08-数学内置对象Math</title>
  </head>

  <body>
    <script>
      //1. 属性
      console.log(Math.PI)

      //2. 方法
      // ceil 天花板 向上取整
      console.log(Math.ceil(1.5))
      console.log(Math.ceil(1111.0000000000001))
      console.log(Math.ceil(1.999999))

      //floor  地板  向下取整
      console.log(Math.floor(5.9999999999999999))
      console.log(Math.floor('12px'))
      console.log('----------------------')
      //四舍五入  round
      console.log(Math.round(22.49))
      console.log(Math.round(17.51))
      console.log(Math.round(-20.5))
      console.log(Math.round(-20.51))
      console.log('----------------------')
      //取整函数 parseInt(1.2)     // 1
      //取整函数 parseInt('12px')  //12
      console.log(Math.max(1, 2, 3, 4, 5))
      console.log(Math.min(1, 2, 3, 4, 5))

      //求幂
      console.log(Math.pow(4, 3)) // 4 的 3次方

      //绝对值
      console.log(Math.abs(-23))

      //开根号
      console.log(Math.sqrt(81))
    </script>
  </body>
</html>
